<template>
  <div class="gonggao">
    <!-- 公告 -->
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>公告</span>
        <el-tooltip content="统计***" placement="bottom" effect="light">
          <i class="iconfont icon-askoutline"></i>
        </el-tooltip>
      </div>
      <div v-for="o in 2" :key="o" class="margin-tb -margin-l">
        <i
          class="iconfont icon-info"
          style="color: rgb(73, 212, 85); font-weight: bold; margin-right: 2px"
        ></i>
        <span class="text-12">{{ "senseCAP V3 02020-02-13 14:28:07" }}</span>
      </div>
    </el-card>
  </div>
</template>

<script>
import { $deviceCount } from "@/api/index.js";

export default {
  name: "Gonggao",
  data() {
    return {
      // 对于从后台获取的对象，需要现在变量里定义一个默认值，为了渲染不报错
      deviceObj: {
        LoRaPP: "",
        LoRaWAN: "",
        group: "",
        sensor: "",
      },
    };
  },
  mounted() {
    this.getDevice();
  },
  methods: {
    getDevice() {
      $deviceCount().then((res) => {
        this.deviceObj = res.data.data;
      });
    },
  },
};
</script>

<style scoped lang="scss">
.el-card {
  /deep/ .el-card__header {
    padding: 10px 10px;
    border-bottom: 1px solid #ebeef5;
    box-sizing: border-box;
  }
}

.gonggao {
  .box-card {
    height: 193px;
  }
}

.margin-tb {
  margin: 5px 0;
}
.-margin-l {
  margin-left: -10px;
}
.text-12 {
  font-size: 12px;
  white-space: nowrap;
}
</style>
